package com.cz.run.config.mybatis;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Description: TODO()
 * @auther:CAIYJ
 * @Date:2018/5/14 9:36
 */
@Component
@ConfigurationProperties(prefix = "spring.datasource.law")
public class DataSourceProperties {

    /**
     * @Fields driverClassName : TODO(使用的JDBC驱动的完整有效的java 类名)
     */

    private String driverClassName;

    /**
     * @Fields url : TODO( 传递给JDBC驱动的用于建立连接的UR)
     */

    private String url;

    /**
     * @Fields username : TODO(传递给JDBC驱动的用于建立连接的用户名)
     */

    private String username;

    /**
     * @Fields password : TODO(传递给JDBC驱动的用于建立连接的密码)
     */

    private String password;

    /**
     * @Fields minIdle : TODO(最大空闲连接 ;如果设置为0则不创建)
     */

    private Integer minIdle;

    /**
     * @Fields maxActive : TODO(最大活动连接 ;如果设置为非正数则表示不限制)
     */

    private Integer maxActive;

    /**
     * @Fields maxWait : TODO(最大等待时间 -1表示无限等待)
     */

    private Integer maxWait;

    /**
     * @Fields timeBetweenEvictionRunsMillis : TODO(在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位.
     * 如果设置为非正数,则不运行空闲连接回收器线程)
     */

    private Long timeBetweenEvictionRunsMillis;

    /**
     * @Fields minEvictableIdleTimeMillis :
     * TODO(连接在池中保持空闲而不被空闲连接回收器线程(如果有)回收的最小时间值，单位毫秒)
     */

    private Long minEvictableIdleTimeMillis;

    /**
     * @Fields validationQuery :
     * TODO(SQL查询,用来验证从连接池取出的连接,在将连接返回给调用者之前.如果指定,则查询必须是一个SQL
     * SELECT并且必须返回至少一行记录)
     */

    private String validationQuery;

    /**
     * @Fields testWhileIdle : TODO(指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除.
     * 注意: 设置为true后如果要生效,validationQuery参数必须设置为非空字符串)
     */

    private Boolean testWhileIdle;

    /**
     * @Fields testOnBorrow : TODO(指明是否在从池中取出连接前进行检验,如果检验失败,则从池中去除连接并尝试取出另一个.
     * 注意: 设置为true后如果要生效,validationQuery参数必须设置为非空字符串)
     */

    private Boolean testOnBorrow;

    /**
     * @Fields testOnReturn : TODO(指明是否在归还到池中前进行检验 注意:
     * 设置为true后如果要生效,validationQuery参数必须设置为非空字符串)
     */

    private Boolean testOnReturn;

    /**
     * @Fields poolPreparedStatements : TODO( 开启池的prepared statement 池功能)
     */

    private Boolean poolPreparedStatements;

    /**
     * @Fields maxPoolPreparedStatementPerConnectionSize : TODO(每个连接上PSCache的大小
     * )
     */

    private Integer maxPoolPreparedStatementPerConnectionSize;

    /**
     * @Fields filters : TODO(属性类型是字符串，通过别名的方式配置扩展插件)
     */

    private String filters;

    public String getDriverClassName() {
        return driverClassName;
    }

    public void setDriverClassName(String driverClassName) {
        this.driverClassName = driverClassName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getMinIdle() {
        return minIdle;
    }

    public void setMinIdle(Integer minIdle) {
        this.minIdle = minIdle;
    }

    public Integer getMaxActive() {
        return maxActive;
    }

    public void setMaxActive(Integer maxActive) {
        this.maxActive = maxActive;
    }

    public Integer getMaxWait() {
        return maxWait;
    }

    public void setMaxWait(Integer maxWait) {
        this.maxWait = maxWait;
    }

    public Long getTimeBetweenEvictionRunsMillis() {
        return timeBetweenEvictionRunsMillis;
    }

    public void setTimeBetweenEvictionRunsMillis(Long timeBetweenEvictionRunsMillis) {
        this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
    }

    public Long getMinEvictableIdleTimeMillis() {
        return minEvictableIdleTimeMillis;
    }

    public void setMinEvictableIdleTimeMillis(Long minEvictableIdleTimeMillis) {
        this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
    }

    public String getValidationQuery() {
        return validationQuery;
    }

    public void setValidationQuery(String validationQuery) {
        this.validationQuery = validationQuery;
    }

    public Boolean getTestWhileIdle() {
        return testWhileIdle;
    }

    public void setTestWhileIdle(Boolean testWhileIdle) {
        this.testWhileIdle = testWhileIdle;
    }

    public Boolean getTestOnBorrow() {
        return testOnBorrow;
    }

    public void setTestOnBorrow(Boolean testOnBorrow) {
        this.testOnBorrow = testOnBorrow;
    }

    public Boolean getTestOnReturn() {
        return testOnReturn;
    }

    public void setTestOnReturn(Boolean testOnReturn) {
        this.testOnReturn = testOnReturn;
    }

    public Boolean getPoolPreparedStatements() {
        return poolPreparedStatements;
    }

    public void setPoolPreparedStatements(Boolean poolPreparedStatements) {
        this.poolPreparedStatements = poolPreparedStatements;
    }

    public Integer getMaxPoolPreparedStatementPerConnectionSize() {
        return maxPoolPreparedStatementPerConnectionSize;
    }

    public void setMaxPoolPreparedStatementPerConnectionSize(Integer maxPoolPreparedStatementPerConnectionSize) {
        this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize;
    }

    public String getFilters() {
        return filters;
    }

    public void setFilters(String filters) {
        this.filters = filters;
    }
}
